<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateItemTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /**
         * 创建数据表
         * Schema ==> MySqlBuilder
         * $table = "items" 数据表的名称
         * Closure $callback 数据表的创建SQL
         */
        Schema::create('items', 
        function (Blueprint $table) {
            $table->increments('id');/*自动增长*/
            $table->string('name');/*varchar类型*/
            $table->string('email')->unique();/*varchar类型，并且唯一*/
            $table->string('password');/*密码*/
            // $table->rememberToken();
            $table->timestamps();/*时间戳*/
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('items');
    }
}
